<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="layout :: htmlhead" th:with="title='导航菜单管理'"></head>
<body class="layui-layout-body">
    <div class="layui-layout layui-layout-admin">
        <!--头-->
        <div th:replace="fragments/head :: header"></div>

        <div class="layui-body" style="margin: 1%">
            <!--搜索框Form-->
            <form class="layui-form layui-form-pane" method="post" action="" style="margin-top: 20px;">
                <div class="layui-form-item">
                    <label class="layui-form-label">导航名称</label>
                    <div class="layui-input-inline">
                        <input name="cname" autocomplete="off" class="layui-input" type="text"/>
                    </div>
                </div>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                <button class="layui-btn"  lay-submit="" lay-filter="searchSubmit">提交</button>
            </form>

            <!--水平线颜色-->
            <!--<hr class="layui-bg-blue"/>-->
            <hr class="layui-bg-black"/>

            <button class="layui-btn layui-btn-normal" onclick="addMenu()">新增导航</button>

            <table id="uesrList" lay-filter="userTable"></table>
            <div style="display:none;" id="currentUser"><shiro:principal property="id"></shiro:principal></div>


            <script type="text/html" id="optBar2">
                {{#  if(d.menuType==0){ }}
                <span style="color:green">已开放</span>
                {{#  } else { }}
                <span style="color:red">未开放</span>
                {{#  } }}
            </script>

            <script type="text/html" id="optBar">
    <!--            <a class="layui-btn layui-btn-xs" lay-event="select">查看</a>-->
                <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
                <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
            </script>
        </div>


        <!--添加或编辑导航菜单-->
        <div id="setMenu" class="layer_self_wrap" style="width:500px;display:none;height: 400px">
            <form id="menuForm" class="layui-form layui-form-pane" method="post" action="" style="margin-top: 20px;">
                <input id="cid" type="hidden" name="cid"/>
                <div class="layui-form-item">
                    <label class="layui-form-label">导航名称</label>
                    <div class="layui-input-inline">
                        <input id="cname" name="cname" lay-verify="required" autocomplete="off" class="layui-input" type="text"/>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">链接地址</label>
                    <div class="layui-input-inline">
                        <input id="url" name="url" lay-verify="required" autocomplete="off" class="layui-input" type="text"/>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">排序码</label>
                    <div class="layui-input-inline">
                        <input id="sortCode" name="sortCode" lay-verify="required" autocomplete="off" class="layui-input" type="text"/>
                    </div>
                </div>

<!--                <div class="layui-form-item">-->
<!--                    <label class="layui-form-label">父级导航</label>-->
<!--                    <div class="layui-input-block">-->
<!--                        <select name="parentId"  id="parentId" lay-filter="department">-->
<!--                            <option value=""></option>-->
<!--                        </select>-->
<!--                    </div>-->
<!--                </div>-->

                <div class="layui-form-item">
                    <label class="layui-form-label">功能开放</label>
                    <div class="layui-input-block" id="menuType">
                        <input type="radio" name="menuType" value="1" title="未开放" checked="" />
                        <input type="radio" name="menuType" value="0" title="已开放" />
                    </div>
                </div>

                <div class="layui-form-item">
                    <div class="layui-input-block" style="margin-left: 10px;">
                        <button class="layui-btn"  lay-submit="" lay-filter="userSubmit">提交</button>
                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                    </div>
                </div>
            </form>
        </div>

        <!--底部-->
        <div th:replace="fragments/footer :: footer"></div>
        <script src="/js/dateUtils.js"></script>
        <script src="/js/menu/menuList.js"></script>
    </div>
</body>
</html>